package routers

import (
	"github.com/astaxie/beego"
	"src/gitee.com/wx_e6924dbcd0/notebook/controllers"
)

func init() {
	//过滤器
	//beego.InsertFilter("/*", beego.BeforeRouter, controllers.Filter)
	//页面显示路由
	beego.Router("/?:id", &controllers.Controller{})                     // 起始首页
	beego.Router("/basetext", &controllers.Controller{}, "get:BaseText") //查看全部内容和评论页面
	beego.Router("/upmsgpage", &controllers.Controller{}, "get:UpMsgPage")

	//notebook表
	beego.AutoRouter(&controllers.MainController{})
	//beego.Router("test_model", &controllers.TestModelController{}, "get:Get;post:Post")

	//登录
	beego.Router("/login", &controllers.LoginMainController{})
	beego.Router("/user/login", &controllers.LoginMainController{}, "post:DoLogin")

	//实现UserTable的增删改查
	beego.Router("/user", &controllers.UserMainController{}, "get:Get")
	//查
	beego.Router("/user/getone", &controllers.UserMainController{}, "get:GetOneUser")
	//注册
	beego.Router("/user/register", &controllers.UserMainController{}, "post:DoRegister")
	//查询用户表
	beego.Router("/userlist/page", &controllers.UserMainController{}, "get:UserList")
	beego.Router("/user/list", &controllers.UserMainController{}, "get:GetUserList")
	//删除用户
	beego.Router("/user/del", &controllers.UserMainController{}, "post:DelUserById")
	//修改用户信息
	beego.Router("/user/edit", &controllers.UserMainController{}, "post:UpUserById")
	//模糊查询
	beego.Router("/user/fuzzy", &controllers.UserMainController{}, "get:FuzzyUser")
	//修改用户禁言在他
	beego.Router("/user/status/edit", &controllers.UserMainController{}, "post:DoEditStatus")

	//实现Message表
	beego.Router("/content/detail/?:id", &controllers.MegMainController{})
	//查询信息表meglist
	beego.Router("/contentlist/page", &controllers.MegMainController{}, "get:MegList")
	beego.Router("/content/getlist", &controllers.MegMainController{}, "get:GetMegList")
	//查询一条信息
	beego.Router("/content/getone", &controllers.MegMainController{}, "get:GetOneMessage")
	//查询当天信息
	beego.Router("/content/nowday", &controllers.MegMainController{}, "get:NowDaysMessage")
	//添加信息
	beego.Router("/content/addpage", &controllers.MegMainController{}, "get:AddMessagePage")
	beego.Router("/content/add", &controllers.MegMainController{}, "post:DoAddMessage")
	//删除信息
	beego.Router("/content/del", &controllers.MegMainController{}, "post:DelMsgById")
	//模糊查询
	beego.Router("/content/fuzzy", &controllers.MegMainController{}, "post:Fuzzy")
	//信息更新
	beego.Router("/content/edit", &controllers.MegMainController{}, "post:UpMsge")
	beego.Router("/content/status/edit", &controllers.MegMainController{}, "post:EditMsgStatus")

	//获取点赞Tmb
	beego.Router("/tmblist", &controllers.TmbMainController{}, "post:TmbList")
	//点赞Tmb
	beego.Router("/tmbu", &controllers.TmbMainController{}, "post:TmbUp")
	//取消点赞
	beego.Router("/deltmb", &controllers.TmbMainController{}, "post:DelTmb")

	//获取评论表
	beego.Router("/message/list", &controllers.CriMainController{}, "get:CriList")
	beego.Router("/message/list/byname", &controllers.CriMainController{}, "get:CriListName")
	beego.Router("/message/listapt", &controllers.CriMainController{}, "get:CriListApt")
	beego.Router("/message/list/uncheck", &controllers.CriMainController{}, "get:GetUnCheckComment")
	//评论
	beego.Router("/message/add", &controllers.CriMainController{}, "post:DoComment")
	//取消评论
	beego.Router("/message/del", &controllers.CriMainController{}, "post:DelComment")
	//反对评论和取消反对评论
	beego.Router("/message/oppose", &controllers.CriMainController{}, "post:Oppose")
	beego.Router("/message/unoppose", &controllers.CriMainController{}, "post:UnOppose")
	//支持评论和取消支持评论
	beego.Router("/message/support", &controllers.CriMainController{}, "post:Support")
	beego.Router("/message/unsupport", &controllers.CriMainController{}, "post:UnSupport")
	//修改评论状态
	beego.Router("/message/statue", &controllers.CriMainController{}, "post:UpSta")
	//Check值改为0
	beego.Router("/message/check", &controllers.CriMainController{}, "post:DoEditCheck")

	//获取公告列表
	beego.Router("/notice/list", &controllers.NoticeMainController{}, "get:NoticeList")
	//上传公告
	beego.Router("/notice/add", &controllers.NoticeMainController{}, "post:DoAddNotice")
	//删除公告
	beego.Router("/notice/del", &controllers.NoticeMainController{}, "post:DoDelNotice")
	//公告置顶
	beego.Router("/notice/edit", &controllers.NoticeMainController{}, "post:DoUpNotice")

	//打开联系页面
	beego.Router("/link/page", &controllers.LinkMainController{}, "get:LinkPage")
	//获取联系表
	beego.Router("/link/list", &controllers.LinkMainController{}, "get:LinkList")
	//联系管理员或发送内容
	beego.Router("/link", &controllers.LinkMainController{}, "post:DoLink")
	//删除联系内容
	beego.Router("/link/del", &controllers.LinkMainController{}, "post:DelLinkComment")
	//修改状态值
	beego.Router("/link/status", &controllers.LinkMainController{}, "post:UpLinkSta")
}
